SETLOCAL DisableDelayedExpansion
REM Run all sql scripts in a directory

REM -----------------------
REM Loop through and execute all of the scripts.
REM -----------------------
REM ECHO Runnning SQL scripts for %4 , %%f

REM -----------------------
REM Execute each script via osql
REM -----------------------
ECHO ====================================
ECHO Running scripts in %4
ECHO.
FOR %%f IN (%4\*.sql) DO (
    ECHO Executing "%%f"
    sqlcmd -S %1 -U %2 -P %3 -i "%%f" -W -m-1 -b -f 65001
    ECHO.
)
